<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <!-- startsWith判断字符串是否以某个字符开头 -->
  <!-- endsWith判断字符串是否以某个字符结尾 -->
  <script>
    let str = "hellow word 2015";
    console.log(str.startsWith("hellow"));
    console.log(str.endsWith("2015"));
  </script>
</body>

</html>